#if UNITY_EDITOR

using UnityEditor;
using AI.Graph.Editor;

[CustomEditor (typeof (EnableGameObjectSubState))]
public class EnableGameObjectSubStateView : SubStateView {

    private SerializedProperty gameObjectParameter;
    private SerializedProperty enableGameObject;


    protected override void OnInspectorEnable () {
        gameObjectParameter = serializedObject.FindProperty ("gameObjectParameter");
        enableGameObject = serializedObject.FindProperty ("enableGameObject");
    }


    protected override void OnNodeGUI () {
        serializedObject.Update ();

        EditorGUILayout.PropertyField (gameObjectParameter);

        int value = EditorGUILayout.Popup ("On Perform", enableGameObject.boolValue ? 0 : 1, new[] {"Enable", "Disable"});
        enableGameObject.boolValue = value == 0;

        serializedObject.ApplyModifiedProperties ();
    }


    public override void OnInspectorGUI () {
        OnNodeGUI ();
    }

}
#endif